package com.doit.demo06;

/*/线程的安全问题
    解决方案:
    1.线程同步
        a.同步代码块
            syncharonized(任意对象)  任意对象:锁,对象锁,锁对象,官方说法:对象监视器
            { 可能出问题的代码}
    2.lock锁
*/
@SuppressWarnings("all")
public class test {
    public static void main(String[] args) {
        tickt t = new tickt();
        Thread t1 = new Thread(t);
        Thread t2 = new Thread(t);
        Thread t3 = new Thread(t);

        t1.setName("APP");
        t2.setName("网页");
        t3.setName("线下人工");

        t1.start();
        t2.start();
        t3.start();
    }
}
